package com.common.converter;

import com.common.entity.department.DepartmentEntity;
import com.common.entity.target.TargetTypeEntity;
import com.common.requestvo.departmentjob.DepartmentReqVo;
import com.common.requestvo.target.TargetTypeReqVo;
import com.common.vo.departmentjob.DepartmentVo;
import com.common.vo.target.TargetTypeVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface TargetTypeConverter {

    TargetTypeConverter INSTANCE = Mappers.getMapper(TargetTypeConverter.class);


    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    TargetTypeVo domain2vo(TargetTypeEntity targetTypeEntity);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    TargetTypeEntity vo2domain(TargetTypeReqVo targetTypeReqVo);
}